<?
// *************************************
// * events.php allows the admin to
// * Add, View and Update events and
// * check registration, print nametags.
// *************************************
$toolbox  = 1;
$sajax    = 1;
$richtext = 1;
define('SITE_AREA', 'events');

$jsFile = "jsEvents.js";
include("includes/functions.php");
include($pre."includes/sajax/sajaxEvents.php");

sajax_init();
$sajax_request_type = "POST"; 
sajax_export("getCurrentEvents");
sajax_export("getFilesFromDir");
sajax_export("swapActive");
sajax_export("swapOnHome");
sajax_export("saveEvent");
sajax_export("deleteEvent");
sajax_export("getEventForEdit");

sajax_export("getRegistered");
sajax_handle_client_request();

$eCategories = getCategories('select','C'); 

include("includes/header.php"); ?>
	<script language="javascript" type="text/javascript" src="<?=$pre; ?>js/tinyeditor/config/mceConfig.js"></script>
	<div id="addEditFormDiv" style="display: none;"></div>	
	<input type="hidden" id="itemID" />
			
	<div id="content0">
		<div id="buttonNew" style="float: left; width: 180px;"><input type="button" class="buttonBig buttonAddBig" value="New Event" onClick="addEvent();" title="Add new event" id="buttonNewEvent" /></div>
		<div id="statusDiv" style="float: left;"></div>
		<div style="clear: left; height: 10px;"></div>
		
		<div id="content0FormDiv">
			<div id="formAddContainer">
				<div id="formNewEvents" class="blueBox" style="display: none;">		
				
				<input type="hidden" id="formAction" />
				<input type="hidden" id="eID" />
				<p><label class="vertLabel">Category</label>
				<select id="eCat" size="1" style="width: 400px;">
				<?=$eCategories; ?>
				</select>		
				<p><label class="vertLabel">Title</label>
				<input type="text" style="width: 400px;" id="eTitle" name="eTitle" /></p>
		
				<p><label class="vertLabel">Event Dates</label>
				<div style="margin-left: 6px;">
					<div style="float: left; width: 200px;"><input type="text" id="eDateStart" value="" /></div>
					<div style="float: left; width: 185px;"><input type="text" id="eDateEnd" value="" /></div>
					<div style="float: left;">
						<? toolTip('eventFormDates'); echo $toolTip; ?>
					</div>
					<div style="clear: left;"></div>
				</div>
				</p>
		
				<p><label class="vertLabel">Event Time(s)</label>
				<input type="text" style="width: 400px;" id="eTimes" name="eTimes" />
				</p>					
				
				<p><label class="vertLabel">More Information URL</label>
				<input type="text" style="width: 400px;" value="http://" id="eURL" name="eURL" /></p>
			
				<p>
					<label class="vertLabel">
						<input type="checkbox" id="eOnHome" value="1" />
						Display this event on the home page.</label>
				</p>	
										
				<p style="margin-top: 10px;"><label class="vertLabel">Description</label>
				<textarea name="eDesc" id="eDesc" class="editorAlmostSimple" style="width: 600px; height: 200px;"></textarea>
				</p>
		
				<p><label class="vertLabel">Location</label>
				<textarea name="eLocation" id="eLocation" style="width: 400px; height: 80px;"></textarea>
				</p>
									
				<div style="float: left; margin-top: 15px; margin-left: 6px;">
					<input type="button" class="buttonBig buttonSaveBig" onClick="saveEvent();" value="Save" title="Save resource" />
					<input type="button" class="buttonBig buttonCancelBig" onClick="cancelNewEvent();" value="Cancel" title="Cancel" />
				</div>
			
				<div style="margin-top: 20px; margin-left: 10px; float: left;" id="formStatus"></div>
				<div style="clear: left;"></div>	
				
				</div>
			</div>	
		</div>
		<div id="currentEvents" style="margin-top: 20px;"></div>
	</div>
	
	<div id="content1">
		<div style="float: right;">
			<a href="#" onClick="goPrint('register',0); return false;"><img src="images/buttonPrintList.gif" style="border: none;" /></a>
			<a href="#" onClick="goPrint('pdfNametags',0); return false;"><img src="images/buttonPrintNametags.gif" style="border: none;" /></a>
		</div>
		<div style="clear: right;"></div>
		<div id="registrationList"></div>
	</div>	
	
	<div id="south" class="x-layout-inactive-content">
	south - generally for informational stuff, also could be for status bar
	</div>
<? include("includes/footer.php"); ?>